<template>
  <div>
      <div v-for="(j,i,index) in nr">
        {{i}}
        <p><a-date-picker @change="onChange" v-if="j=='date'&& i=='请假日期'" /></p>
        <p><a-date-picker @change="onChange" v-if="j=='date'&& i=='结束日期'" /></p>
        <a-input type="j" v-if="j=='txt'"></a-input>
        <select v-if="j=='select'">
          <option :value="f.id" v-for="f in shr">{{f.username}}</option>
        </select>
      </div>
    <a-button type="primary" @click="add">
      添加
    </a-button>


  </div>
</template>

<script>
import axios from 'axios'
export default {
  name: "cate",
  data() {
    return {
      id: this.$route.query.id,
      nr:[],
      shr:[],
    }
  },
  methods:{
    add(){

    },
    onChange(date, dateString) {
      console.log(date, dateString);
    },
  },
  created() {
    axios({
      url:'http://127.0.0.1:8000/cate/?id='+this.id
    }).then(res =>{
      console.log(res.data)
      this.nr = res.data
    })
    axios({
      url:'http://127.0.0.1:8000/user/'
    }).then(res =>{
      console.log(res.data)
      this.shr = res.data
    })
  }
}
</script>

<style scoped>

</style>